<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ question.question_text }} - 投票</title>
    <style>
        body {
            font-family: 'Helvetica Neue', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f5faf5;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }
        
        h1 {
            color: #2e7d32;
            text-align: center;
            margin-bottom: 10px;
            font-size: 2em;
        }
        
        .vote-form {
            background-color: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            margin-top: 20px;
        }
        
        fieldset {
            border: 2px solid #c8e6c9;
            border-radius: 8px;
            padding: 25px;
            margin-bottom: 25px;
        }
        
        legend {
            padding: 0 15px;
            color: #2e7d32;
            font-weight: bold;
            font-size: 1.2em;
        }
        
        .error-message {
            color: #d32f2f;
            background-color: #ffebee;
            padding: 10px 15px;
            border-radius: 5px;
            margin-bottom: 20px;
            border-left: 4px solid #d32f2f;
        }
        
        .choice-option {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            padding: 12px 15px;
            background-color: #e8f5e9;
            border-radius: 6px;
            transition: all 0.2s;
        }
        
        .choice-option:hover {
            background-color: #c8e6c9;
        }
        
        input[type="radio"] {
            margin-right: 15px;
            transform: scale(1.3);
            accent-color: #2e7d32;
        }
        
        label {
            font-size: 1.1em;
            cursor: pointer;
            flex-grow: 1;
        }
        
        .submit-btn {
            display: block;
            width: 100%;
            padding: 14px;
            background-color: #2e7d32;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1.1em;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .submit-btn:hover {
            background-color: #1b5e20;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body>
    <form action="{% url 'polls:vote' question.id %}" method="post" class="vote-form">
        {% csrf_token %}
        <fieldset>
            <legend><h1>{{ question.question_text }}</h1></legend>
            
            {% if error_message %}
                <div class="error-message">
                    <strong>{{ error_message }}</strong>
                </div>
            {% endif %}
            
            {% for choice in question.choice_set.all %}
                <div class="choice-option">
                    <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
                    <label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label>
                </div>
            {% endfor %}
        </fieldset>
        
        <input type="submit" value="提交投票" class="submit-btn">
    </form>
</body>
</html>